]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionPrefs: Connect to ExtensionStateChanged after building UI
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 9 Sep 2019 15:06:55 +0000 (17:06 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 9 Sep 2019 19:50:31 +0000 (19:50 +0000)
Since we manipulate parts of the UI (like the switch) in this signal
handler, let's only connect it after setting up the UI.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/705

js/extensionPrefs/main.js

index 4125605b96940925b82211c3088a39c033b55245..1a0783bdd1b2fdd60977d61706fc248a614957ee 100644 (file)
@@ -567,6 +567,10 @@ class ExtensionRow extends Gtk.ListBoxRow {
         this._extension = extension;
         this._prefsModule = null;
 
+        this.connect('destroy', this._onDestroy.bind(this));
+
+        this._buildUI();
+
         this._extensionStateChangedId = this._app.shellProxy.connectSignal(
             'ExtensionStateChanged', (p, sender, [uuid, newState]) => {
                 if (this.uuid !== uuid)
@@ -577,10 +581,6 @@ class ExtensionRow extends Gtk.ListBoxRow {
                 this._switch.state = state;
                 this._switch.sensitive = this._canToggle();
             });
-
-        this.connect('destroy', this._onDestroy.bind(this));
-
-        this._buildUI();
     }
 
     get uuid() {